<template>
	<view class="title-box">
		<!-- #ifdef H5 -->
		<image src="../../static/common/goback.png" class="goback" @tap="gobackPage"></image>
		<!-- #endif -->
		<!-- #ifdef APP-PLUS || MP-WEIXIN -->
		<image src="../../static/common/goback.png" class="goback" @tap="gobackPage"></image>
		<!-- #endif -->
		<view class="tixian-jilu" v-if="text" @tap="goCashHistory">记录</view>
		<view class="title-text">{{title}}</view>
	</view>
</template>

<script>
	export default{
		name:"commonTitle",
		data(){
			return{
				
			}
		},
		props:{
			title:{
				type:String
			},
			img:{
				type:String
			},
			text:{
				type:Boolean,
				default:false
			}
		},
		methods:{
			gobackPage(){
				uni.navigateBack({
					delta:1,
					animationType:'slide-out-right'
				})
			},
			goCashHistory(){
				this.$emit('goCashHistory');
			}
		}
		
	}
</script>

<style>
	.title-box{
		width: 100%;
		height: 58upx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		position: relative;
	}
	.goback{
		position: absolute;
		width: 58upx;
		height: 58upx;
		left: 51upx;
		top: 0;
	}
	.title-text{
		font-size:20px;
		font-family:Alibaba PuHuiTi;
		font-weight:500;
		color:rgba(244,99,122,1);
		opacity:1;
	}
	.tixian-jilu{
		position: absolute;
		right: 50upx;
		top: 10upx;
		font-size: 18px;
		z-index: 20;
		color:rgba(244,99,122,1);
	}
</style>
